﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Questionnaire.aspx.cs" Inherits=" ZX.TR.Web.Questionnaire"  ValidateRequest="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>问卷调查</title>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../Scripts/funcToExcel.js" type="text/javascript"></script>
    <link href="../Styles/extendTable.css" rel="stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function document.oncontextmenu() {
            //event.returnValue = false; //屏蔽鼠标右键
        }

        function showMsg(msg) {
            alert("错误：" + msg);
        }

        function closeWins() {
            this.window.opener = null; 
            window.close();   
        }

        function SubmitTemp() {
            var btnTemp = document.getElementById("btnSave");
            if (btnTemp == null || btnTemp == undefined) {
                alert("还未开始问卷，不能提交，请点击开始问卷");
                return;
            } 
            else {
                if (confirm("提交后无法修改，您确定提交吗？")) {
                    __doPostBack("btnSave", "");
                }
            }
        }
    </script>
    <style type="text/css">
    body{font-family: 宋体, Arial, Helvetica, sans-serif;font-size: 12px;color: #333333;background-color: #FFFFFF;}
    td { border: 1px solid #CCCCCC;}
    .textarea{width: 96%; height: 25px; }
    A:link { text-decoration: none;color: blue;}
    A:visited{text-decoration: none;color: #80006f;}
    A:hover{ text-decoration: underline;color: red;}
    .alg{text-align: center; }
    .requisite{font-family: "宋体";color: #cc0000;}
    .Header{ font-size: 14px;font-weight: bold;padding: 5px;}
    .Header tr{border:1px solid #ccc;background-color:#eee;}        
    .Header tr td {height: 30px;}
    .TableData{font-size:14px;font-weight:bold;padding:5px;}
    .TableBlock{margin-bottom:2px;}
    .TableBlock td{border:1px solid #ccc; background-color:#efe;}
    .imgbutton{cursor:hand;filter:Alpha(Opacity=70, FinishOpacity=92, Style=2)}
    .imgbuttonhover{cursor: hand;position:relative;top:1px;left: 1px;}
    .imgbuttondisabled{cursor: wait;filter:Alpha(Opacity=60, FinishOpacity=80, Style=3) Gray }        
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Panel ID="plMenu" runat="server">
    <div align="left" id="divMenu">
        <img src="../Images/comm/mixexcellite.gif" alt="输出" width="55" height="24" border="0" align="absmiddle" class="imgbutton" onMouseOver="onMouseOverImgBtn(this)"  onMouseOut="onMouseOutImgBtn(this)" id="ExcelIB" onClick="exportToExecl();"/>	    
    </div>
    </asp:Panel>
    <div id="divReport">
        <table align="center" class="TableBlock" width="99%">
        <tr>
            <td align="left" class="TableData" width="75">问卷名：</td>
            <td align="left" class="TableData" colspan="3">
                <asp:Label ID="lblWjName" runat="server"></asp:Label>
                <asp:Label ID="lbQuestionnaireID" runat="server" Visible="false"></asp:Label>
            </td>
        </tr>
        <asp:Panel ID="plLink" runat="server">
        <tr>
            <td align="left" class="TableData" width="75">问卷地址：</td>
            <td align="left" class="TableData" colspan="3">
                <asp:Label ID="lbLink" runat="server"></asp:Label>
            </td>
        </tr>
        </asp:Panel>
        <asp:Panel ID="plbegin" runat="server">
        <tr>
            <td align="left" class="TableData" width="75">发起部门：</td>
            <td align="left" class="TableData" >
                <asp:Label ID="txtDept" runat="server"></asp:Label>
            </td>
            <td align="left" class="TableData" width="75">时长：</td>
            <td align="left" class="TableData" >
                <asp:Label ID="txtTime" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left" class="TableData" width="75">问卷目的：</td>
            <td colspan="3" align="left" class="TableData">
                <asp:Label ID="txtAim" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left" class="TableData" width="75">问卷须知：</td>
            <td colspan="3" align="left" class="TableData">
                <asp:Label ID="txtKnown" runat="server"></asp:Label>
            </td>
        </tr>
        </table>
        
        <table align="center" class="TableBlock" width="99%">
            <tr>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>姓名：</td>
                <td align="left" class="TableData" width="75">
                    <input id="EmpName" name="EmpName" type="text" runat="server" />
                </td>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>工号：</td>
                <td align="left" class="TableData" width="75">
                    <input id="EmployeeCode" name="EmployeeCode" type="text" runat="server" />
                </td>
            </tr>
             <tr>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>部门：</td>
                <td align="left" class="TableData" width="75">
                    <input id="DeptName" name="DeptName" type="text" runat="server" />
                </td>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>职务：</td>
                <td align="left" class="TableData" width="75">
                    <input id="PostName" name="PostName" type="text" runat="server" />
                </td>
            </tr>
             <tr>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>联系电话：</td>
                <td align="left" class="TableData" width="75">
                    <input id="Phone" name="Phone" type="text" runat="server" />
                </td>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>手机：</td>
                <td align="left" class="TableData" width="75">
                    <input id="MobliePhone" name="MobliePhone" type="text" runat="server" />
                </td>
            </tr>
              <tr>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>公司名称：</td>
                <td align="left" class="TableData" width="75">
                    <input id="Company" name="Company" type="text" runat="server" />
                </td>
                <td align="left" class="TableData" width="75"><span class="requisite">*</span>E-mail：</td>
                <td align="left" class="TableData" width="75" >
                    <input id="EMail" name="EMail" type="text" runat="server" />
                </td>
            </tr>
        </table>
        <table class="tableContent">
            <tr>
                <td align="left" class="TableData" width="30">
                    答题方式：
                </td>
                <td align="left" class="TableData" width="75">
                    <asp:RadioButtonList ID="rbtnSelect" runat="server" AutoPostBack="true" OnSelectedIndexChanged="rbtnSelect_SelectedIndexChanged"
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">列表答题</asp:ListItem>
                        <asp:ListItem Value="1">单题答题</asp:ListItem>
                    </asp:RadioButtonList> 
                </td>
                <td align="right" class="TableData" width="75">
                    <asp:Button ID="btnBegin" runat="server" Text="开始问卷" CausesValidation="False" OnClick="btnBegin_Click" />&nbsp;&nbsp;
                    <input type="button" id="btnSubmitTemp" value="提交" onclick="SubmitTemp()" style="display:none" />
                </td>
            </tr>
            <tr>
            <td align="left" class="TableData">
                <asp:Label ID="lblShow" Text="" runat="server"></asp:Label>
            </td>
            </tr>
        </table>
        </asp:Panel>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
        <table align="center" class="tableContent">
            <tr>
                <td>   
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="pnlList" CssClass="alg" Visible="false" runat="server"> 
                            <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer>
                            <span>
                                开始时间为：<label style="color: Red"><%=startTime%></label>&nbsp;&nbsp;
                                时长：<label style="color: Red"><%=longTime %></label>(分钟)&nbsp;&nbsp;
                                倒计时：<label style="color: Red"><%=message%> &nbsp;&nbsp;<b>如果时间达到规定时间，系统自动提交</b></abel>
                            </span> 
                        </asp:Panel>
                    </ContentTemplate>  
                    </asp:UpdatePanel>
                    <asp:Panel ID="pnlEn" runat="server">
                    <asp:Repeater ID="rptList" runat="server" OnItemDataBound="rptList_ItemDataBound">
                        <HeaderTemplate>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table class="tableContent">
                                <tr>
                                    <td style="text-align: right"><%#Eval("sequence") %>、
                                        <asp:HiddenField ID="subjectInfoID" runat="server" Value='<%#Eval("TrSubjectInfoID")%>'></asp:HiddenField>
                                        <asp:HiddenField ID="questionnaireSubjectID" runat="server" Value='<%#Eval("TrQuestionnaireSubjectID")%>'></asp:HiddenField>
                                        <asp:HiddenField ID="IsJumpOver" runat="server" Value='<%#Eval("IsJumpOver")%>'></asp:HiddenField>
                                    </td>
                                    <td colspan="3" style="text-align: left">
                                        【<asp:Label ID="lblType" runat="server" Text='<%#Eval("SubjectType")%>' Visible="true"></asp:Label>】
                                        <%#Eval("SubjectContent")%> <%#GetIsJump(Eval("IsJumpOver"))%> 
                                    </td>
                                </tr>
                                <tr style='display: <%#((Eval("SubjectType").ToString()=="单选题")||(Eval("SubjectType").ToString()=="多选题"))?"":"none"%>'>
                                    <td style="text-align: right">
                                        选项内容：
                                    </td>
                                    <td colspan="3" style="text-align: left">
                                        <asp:Repeater ID="rptItem" runat="server">
                                            <ItemTemplate>
                                            <%#Eval("ItemCode")%>.<%#Eval("SunjectItem")%><br />                                                  
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </td>
                                </tr>
                                <asp:Panel ID="plAnswer" runat="server" Visible="false">
                                <tr>
                                    <td style="text-align: right;width:75px;">
                                        您的答案：
                                    </td>
                                    <td colspan="3" style="text-align: left">
                                        <asp:RadioButtonList ID="rbtnAnswer" runat="server" Visible="false" RepeatDirection="Horizontal"></asp:RadioButtonList>
                                        <asp:CheckBoxList ID="chkAnswer" runat="server" Visible="false" RepeatDirection="Horizontal"></asp:CheckBoxList>
                                        <asp:TextBox ID="txtAnswer" runat="server" Height="50px" TextMode="MultiLine" Width="474px"></asp:TextBox>
                                    </td>
                                </tr>
                                </asp:Panel>
                                <asp:Panel ID="pnExplain" runat="server" Visible="false">
                                <tr>
                                    <td style="text-align: right">
                                        说明：
                                    </td>
                                    <td colspan="3" style="text-align: left">
                                        <asp:TextBox ID="txtExplain" runat="server" Text='<%#Eval("Explain") %>' Visible="false" Width="474px"></asp:TextBox>  
                                    </td>
                                </tr>
                                </asp:Panel>
                                <tr>
                                    <td colspan="4"  style="border:0">&nbsp;</td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <FooterTemplate>
                        </FooterTemplate> 
                    </asp:Repeater>   
                    </asp:Panel> 
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: right; padding-right: 16px;">
                    <asp:Button ID="btnPre" runat="server" Text="上一题" Visible="false" Enabled="true" OnClick="btnPre_Click" />
                    <asp:Button ID="btnNext" runat="server" Text="下一题" Visible="false" OnClick="btnNext_Click" />
                    <asp:Button ID="btnSave" runat="server" Text="提交" Visible="false" CausesValidation="false" OnClick="btnSave_Click" OnClientClick="return confirm('提交后无法修改，您确定提交吗？') "/>

                </td>
            </tr>
        </table>
    </div>
    <div id="ExcelTitleDiv" style="display:none" ></div>
    <div id="ExcelDiv" style="display:none" ></div>
    </form>
</body>
</html>
<form action="exportExcel.aspx" method="post" id="ExcelFrm" name="ExcelFrm" target="_blank">
    <input id="fileName" name="fileName" value="<%=questionnaireName %>_题目"  type="hidden"/>
</form>
